package com.neteast.bustruck.ui

import android.app.Activity
import android.view.LayoutInflater
import android.view.ViewGroup
import android.webkit.WebView
import com.just.agentweb.IWebLayout
import com.neteast.bustruck.R
import com.neteast.bustruck.view.MyWebView
import com.scwang.smart.refresh.layout.SmartRefreshLayout

/**
 * Created by cenxiaozhong on 2017/7/1.
 * source code  https://github.com/Justson/AgentWeb
 */
class WebLayout(private val mActivity: Activity) : IWebLayout<MyWebView?, SmartRefreshLayout?> {



    private val mTwinklingRefreshLayout: SmartRefreshLayout =
        LayoutInflater.from(mActivity)
            .inflate(R.layout.layout_twk_web, null) as SmartRefreshLayout
    private var mWebView: MyWebView? = null

    init {
        mWebView = mTwinklingRefreshLayout.findViewById(R.id.webView)
    }

    override fun getLayout(): SmartRefreshLayout {
        return mTwinklingRefreshLayout
    }

    override fun getWebView(): MyWebView? {
        return mWebView
    }
}